package main

import "fmt"

func readByExt(ext string) {
	switch ext {
	case "json":
		fmt.Println("read json file")
	case "jpg", "jpeg", "png", "gif":
		fmt.Println("read image file")
	case "txt", "md":
		fmt.Println("read text file")
	case "yml", "yaml":
		fmt.Println("read yaml file")
	case "ini":
		fmt.Println("read ini file")
	default:
		fmt.Println("unsupported file extension:", ext)
	}
}

func main() {
	var ext = "json"
	readByExt(ext)
}
